package com.mypog;

public class User {
	private String name, enemy = "", hitOrMiss = null, won = "0", lost = "0";
	private boolean ready = false, myTurn = false;
	private int changeId = 404; //update gui, if 3, dont update.
	private int squareCounterPlayer = 20; // Ship pieces in table.
	private int id;
	
	// Ship array.
	int[] shipsPlayer = new int[100];	
	
	public User(String name) {
		this.name = name;
		
		for (int i = 0; i < shipsPlayer.length; i++) {
			shipsPlayer[i] = 0;
		}	
	}
	
	public void reset(){
		enemy = "";
		ready = false;
		myTurn = false;
		changeId = 404;
		hitOrMiss = null;
		squareCounterPlayer = 20;
		shipsPlayer = new int[100];
		
		for (int i = 0; i < shipsPlayer.length; i++) {
			shipsPlayer[i] = 0;
		}
	}
	
	public String getName() {
		return name;
	}
	
	public int getShip(int id) {
		return shipsPlayer[id];
	}

	public void setShip(int id, int value) {
		shipsPlayer[id] = value;
	}

	public boolean isReady() {
		return ready;
	}

	public void setReady(boolean ready) {
		this.ready = ready;
	}

	public String getEnemy() {
		return enemy;
	}

	public void setEnemy(String enemy) {
		this.enemy = enemy;
	}

	public void setShipsPlayer(int[] shipsPlayer) {
		this.shipsPlayer = shipsPlayer;
	}

	public boolean isMyTurn() {
		return myTurn;
	}

	public void setMyTurn(boolean myTurn) {
		this.myTurn = myTurn;
	}

	public int getChangeId() {
		return changeId;
	}

	public void setChangeId(int changeId) {
		this.changeId = changeId;
	}

	public String getHitOrMiss() {
		return hitOrMiss;
	}

	public void setHitOrMiss(String hitOrMiss) {
		this.hitOrMiss = hitOrMiss;
	}

	public int getSquareCounterPlayer() {
		return squareCounterPlayer;
	}

	public void setSquareCounterPlayer(int squareCounterPlayer) {
		this.squareCounterPlayer = squareCounterPlayer;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}	
	
	public String getWon() {
		return won;
	}

	public void setWon(String won) {
		this.won = won;
	}

	public String getLost() {
		return lost;
	}

	public void setLost(String lost) {
		this.lost = lost;
	}
}


